package com.ozo.easy.exception;

import com.ozo.easy.common.exception.AbstractExceptionEnum;
import lombok.Getter;

/**
 * 异常信息
 *
 * @author ozo
 * @date 2024-12-26
 */
@Getter
public enum ServiceExceptionEnum implements AbstractExceptionEnum {

    /**
     * 20000~29999之间
     */
    USERNAME_EXISTS(20000, "用户名已存在"),
    MOBILE_EXISTS(20001, "手机号已存在"),
    TWO_PASSWORD_NOT_MATCH(20002, "两次输入密码不匹配"),
    OLD_PASSWORD_NOT_RIGHT(20003, "旧密码不正确"),
    CAPTCHA_NOT_RIGHT(20004, "验证码不正确"),
    USERNAME_OR_PASSWORD_NOT_RIGHT(20005, "用户名或密码错误"),

    DEPT_HAS_USER_NOT_DELETE(20100, "部门下存在用户不能删除"),
    DEPT_HAS_CHILDREN_NOT_DELETE(20101, "部门下存在子级不能删除"),
    DEPT_NAME_EXISTS(20102, "部门名称已存在"),

    DICT_CODE_EXISTS(20200, "字典编码已存在"),
    DICT_VALUE_CODE_EXISTS(20201, "字典值已存在"),


    PARENT_NOT_ONESELF(29998, "父级不能选择自己"),
    DATA_NOT_EXISTS(29999, "数据不存在"),

    ;


    private Integer code;

    private String message;

    ServiceExceptionEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

}
